/*
 * CouponValidListItem.java
 * business
 *
 * Created by SunDing on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.displaylistitem;

import android.app.Activity;
import android.content.Context;

import com.yidiandao.business.data.bean.Coupon;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;
import com.yidiandao.business.ui.widget.listview.viewholder.CouponValidHolder;
import com.yidiandao.business.ui.widget.view.RedPacketLayout;
import com.yidiandao.business.utils.JumpUtils;

/**
 * 可用优惠券
 */
public class CouponValidListItem extends DisplayListItem<CouponValidHolder, Coupon> {

    public CouponValidListItem(Coupon coupon) {
        super(coupon);
    }

    @Override
    public void onShow(final Context context, CouponValidHolder holder) {
        holder.refreshUI(data);
        holder.redPacketLayout.setOnChooseGoodsClickListener(new RedPacketLayout.OnChooseGoodsClickListener() {
            @Override
            public void click() {
                JumpUtils.clickChooseGoods((Activity) context, data);
            }
        });
    }

    @Override
    public String getDisplayItemTag() {
        return CouponValidListItem.class.getSimpleName();
    }

    @Override
    public Class<CouponValidHolder> getViewHolderClazz() {
        return CouponValidHolder.class;
    }
}
